<?php
//我的提案

function shencha_default(){
    shencha_page();
}
function shencha_page(){
    _output_template(0,'shencha');
}


function _zhengxie_outputShencha(){
    $nav_name = '审查提案';

    if (empty($_REQUEST['proposalID'])){
        $str= " <div style='padding: 25px; border-radius: 10px;height: 93%;background-color: white; -webkit-box-shadow: #e2f0fe 0px 0px 10px;-moz-box-shadow: #e2f0fe 0px 0px 10px;box-shadow: #e2f0fe 0px 0px 10px;'>
                <div style='width: 100%;min-height: 120px;height: 10%'>
                    <div class='mark' id='".$GLOBALS['ACTION']."' style='color: #429de3;height: 50%;font-size: 18px;'>".$nav_name."</div>
                    <div style='height: 50%;'>";

        $str.="         <div class='box' style='float: left;height: 100%;display: inline-block;position: relative;top: 50%;transform: translateY(-50%)'>
                            <span style='font-size: 16px;float: left;height: 40px;line-height: 40px;margin-right: 15px;position: relative;top: 50%;transform: translateY(-50%)'>状态:</span>
                            <span style='font-size: 16px;color: #666;text-indent: 15px;border: 1px solid #e5e5e5;float: left;border-radius: 4px;width:204px;height:40px;line-height:40px;position: relative;top: 50%;transform: translateY(-50%)'>待审查</span>
                        </div>";



        $str .= "   <div style='display: inline-block;width: 33%;height: 100%;margin-left: 10%;float: left'>
                        <div style='height: 54px;position: relative;top: 50%;transform: translateY(-50%);'>
                            <span style='font-size: 16px;float: left;height: 50px;line-height: 50px;'>提案理由:</span>
                            <div style='padding-left: 80px;position: relative;top: 50%;transform: translateY(-50%)'>
                                <input class='anyou_search' type='text' style='font-size: 16px;color: #666;height: 40px;width: 100%;border: 1px solid #e5e5e5;border-radius: 4px;'>
                            </div>
                        </div>
                        <!--<input type='text' style='font-size: 16px;color: #666;height: 40px;width: 100%;border: 1px solid #e5e5e5;border-radius: 4px;position: relative;top: 50%;transform: translateY(-50%);'>-->
                    </div>
                    <div style='display: inline-block; height: 100%;float: left;margin-left: 15px'>
                        <div style='height: 54px;position: relative;top: 50%;transform: translateY(-50%);'>
                            <button onclick='searchProposalToMark(1);' style='font-size: 16px;color: white;border-radius: 5px;background-color: #42d79e;width: 76px;height: 41px;margin-right: 15px;margin-left: 15px;border: none'>查询</button>
                            <button onclick='resetMessage(1);' style='font-size: 16px;color: #42d79e;border-radius: 5px;border: 1px solid #42d79e;background-color: #fff;width: 76px;height: 41px;'>重置</button>
                        </div>
                    </div>";

        $str.=output_tab();
        return $str;
    }else{
        //取出参数
        $proposalID =  $_REQUEST['proposalID'];
        $data = getProposalInfo($proposalID);
        $user = getUserInfo($data['userid']);
        //承办单位(此处还未指定承办单位)
        $sponsordata = '未指定';
        //党派(查表暂留)
        isset($_REQUEST['taskid'])? updateLookState($_REQUEST['taskid']) : '';

        //最后一次操作
        $lastRecordData = getProposalRecordToLast($proposalID);
        //判断状态是不是拒绝
        $isRefused = false;
        switch ($lastRecordData['operatetype']){
            case '3'://不立案
                $isRefused=true;
                break;
            case '7'://退回
                $isRefused=true;
                break;
            case '10'://不满意
                $isRefused=true;
                break;
        }

        $str = "<div class='solide_box' style='position: relative;width: 100%;border-top-left-radius: 10px;top: 25px;border-top-right-radius: 10px;height: 25px;background-color: white;'></div>";

        //提案类型
        switch ($data['type']){
            case '1':
                $type = '经济类';
                break;
            case '2':
                $type = '文教体卫';
                break;
            case '3':
                $type = '政法统战政协';
                break;
        }

        //文件(查表暂留,用于做查看word文件功能)
        $enclosureid = $data['enclosureid'];

        $str .= "<div class='solide_box' style='overflow-y: auto;height: 950px;background-color: white;border-radius: 10px; -webkit-box-shadow: #e2f0fe 0px 0px 10px;-moz-box-shadow: #e2f0fe 0px 0px 10px;box-shadow: #e2f0fe 0px 0px 10px;'>
                        
                        <div class='solide_box' id='proposalContent' style='min-height: 215px;width: 100%;padding-top: 25px;padding-left: 25px;padding-right: 25px;'>
                            <div style='height: 70px;width: 100%;font-size: 22px;text-indent: 60px;line-height: 70px;background-image:url(/images/shencha/anyou.png);background-repeat: no-repeat;background-position: 4px;'>
                                ".$data['anyou'];

        if($GLOBALS['ACTION'] != 'wode'){
            if ($isRefused){
                $str.="<a class='xinzengcaozuo' href='#' style='margin-top: 15px;display: inline-block;width: 120px;height: 40px;float: right;color: white;background-color: #999999;font-size: 16px;text-align: center;border-radius: 4px;'>
                     <div style='width: 100%;height: 100%;line-height: 40px;text-indent: 0px;'>新增操作</div>
                   </a>";
            }else{
                $str.="<a class='xinzengcaozuo' href='?action=".$GLOBALS['ACTION']."&proposalID=".$proposalID."&dialog=shenchadialog' onclick='' style='margin-top: 15px;display: inline-block;width: 120px;height: 40px;float: right;color: white;background-color: #4e99ff;font-size: 16px;text-align: center;border-radius: 4px;'>
                     <div style='width: 100%;height: 100%;line-height: 40px;text-indent: 0px;'>新增操作</div>
                   </a>";
            }
        }

        isset($_REQUEST['lock'])? $str.="<script>$('.xinzengcaozuo').hide();</script>":'';


                                $str.="<a href='#' style='margin-top: 15px;display: inline-block;width: 120px;height: 40px;float: right;color: white;background-color: #ffba4a;font-size: 16px;text-align: center;border-radius: 4px;margin-right: 20px'>
                                    <div style='width: 100%;height: 100%;line-height: 40px;text-indent: 0px;'>导出数据</div>
                                </a>
                            </div>
                            <div class='userid_flag' id='".$GLOBALS['USERINFO']['id']."' style='height: 190px;width: 630px;margin-left: 60px'>
                                <div style='width: 50%;height:38px;line-height:38px;float: left;font-size: 16px;color: #666666;'>提案人:".$user['realname']."</div>
                                <div class='proposalNum' id='".$data['id']."' style='width: 50%;height:38px;line-height:38px;float: left;font-size: 16px;color: #666666;'>编号:".$data['id']."</div>
                                <div style='width: 50%;height:38px;line-height:38px;float: left;font-size: 16px;color: #666666;'>发起时间:".$data['createtime']."</div>
                                <div style='width: 50%;height:38px;line-height:38px;float: left;font-size: 16px;color: #666666;'>类别:".$type."</div>
                                <div style='width: 50%;height:38px;line-height:38px;float: left;font-size: 16px;color: #666666;background-image:url(/images/shencha/word.png);background-repeat: no-repeat;background-position: 45px;'>文件:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='?action=shencha&proposalID=".$proposalID."&filelist=".$enclosureid."' style='color:#429de3;'>查看/下载</a></div>
                                <div style='width: 50%;height:38px;line-height:38px;float: left;font-size: 16px;color: #666666;'>党派:".$user['party']."</div>
                                <div style='width: 50%;height:38px;line-height:38px;float: left;font-size: 16px;color: #666666;'>街道工委:".$user['street']."</div>
                                <div style='width: 50%;height:38px;line-height:38px;float: left;font-size: 16px;color: #666666;'>承办单位:".$sponsordata."</div>
                                <div style='clear: both'></div>
                            </div>
                            
                            <a class='zhankai' id='zheshiid' style='width:80px;height:40px;color:#e36442;font-size:20px;float:right;position:relative;text-align:end;top:-69px;'><div class='zhankai-image' style='background-image:url(/images/xinjian/zhankai.png);line-height:40px;background-repeat: no-repeat;background-position: 10px;width:80px;height:40px;color:#e36442;font-size:20px;'>展开</div></a>

                            <div class='solide_box' id='showContent' style='display: none;width: 100%;padding-left: 60px;padding-right: 60px;padding-bottom: 30px;font-size: 16px;color: #666666;line-height:30px;'>
                                <div style='width: 100%'>
                                    <div style='float: left;'>提案内容:</div>
                                    <div style='padding-left: 69px;color: #999999;'>".$data['content']."</div>
                                </div>
                                <div style='width: 100%;margin-top: 33px;'>
                                    <div style='float: left;'>提案建议:</div>
                                    <div style='padding-left: 69px;color: #999999;'>".$data['advise']."</div>
                                </div>
                            </div>
                            
                        </div>";






        $str.="<div class='solide_box' style='margin-top: 25px;height: 50px;width: 100%;font-size:16px;padding-left: 25px;padding-right: 25px;border-top: 1px solid #e8e8e8;border-bottom: 1px solid #e8e8e8;'>
                            <b>
                            办理进度
                            </b>
                        </div>
                        <div style='height: 600px;width: 100%;padding-top:40px;'>
                            <div class='solide_box' style='width: 100%;height: 100px;padding-left: 60px;padding-right: 60px;font-size: 16px'>
                            
                                <div style='width: 40px;height: 100%;float: left;'>
                                    <div style='height: 60px;width: 100%'>";
        if ($isRefused){
            $str.="<div style='z-index:1;width: 20px;height: 20px;margin-right: 9px;border-radius: 20px;background-color: red;position: relative;top: 50%;transform: translateY(-50%);float: right'></div>
               <div class='pulseRed' style='position: relative;width: 40px;height: 40px;top: 4px;left:-5px;'></div>";
        }else{
            $str.="<div style='z-index:1;width: 20px;height: 20px;margin-right: 9px;border-radius: 20px;background-color: dodgerblue;position: relative;top: 50%;transform: translateY(-50%);float: right'></div>
               <div class='pulse' style='position: relative;width: 40px;height: 40px;top: 4px;left:-5px;'></div>";
        }
            $str.="</div>
            <div style='height: 30px;width:40px;text-align: center;position: relative;'>立案</div>
        </div>";

        $str.="<div style='width: 100%;height: 100%;'>
                                    <div style='width: 31%;height: 100%;margin-left: 1%;float: left;'>
                                        <div style='height: 60px;width: 100%'>
                                            <div style='height: 30px;width: 100%;line-height: 30px;position: relative;top: 50%;transform: translateY(-50%);'>
                                                <div style='width: 97%;height: 2px;background-color: #c0bfbf;position: relative;top: 50%;transform: translateY(-50%);'></div>
                                                <div style='z-index:1;width: 20px;height: 20px;border-radius: 20px;background-color: #c0bfbf;float: right;margin-right: 5px;position: relative;top: 50%;transform: translateY(-60%);'></div>
                                                <div style='position: relative;width: 40px;height: 40px;top: -13px;right:-36px;float: right;'></div>
                                            </div>
                                        </div>
                                        <div style='height: 30px;text-align: end'>交办</div>
                                    </div>
                                    
                                    <div style='width: 30%;height: 100%;margin-left: 1%;float: left;'>
                                        <div style='height: 60px;width: 100%'>
                                            <div style='height: 30px;width: 100%;line-height: 30px;position: relative;top: 50%;transform: translateY(-50%);'>
                                                <div style='width: 97%;height: 2px;background-color: #c0bfbf;position: relative;top: 50%;transform: translateY(-50%);'></div>
                                                <div style='z-index:1;width: 20px;height: 20px;border-radius: 20px;background-color: #c0bfbf;float: right;margin-right: 5px;position: relative;top: 50%;transform: translateY(-60%);'></div>
                                                <div style='position: relative;width: 40px;height: 40px;top: -13px;right:-36px;float: right;'></div>
                                            </div>
                                        </div>
                                        <div style='height: 30px;text-align: end'>办理</div>
                                    </div>
                                    
                                    <div style='width: 31%;height: 100%;margin-left: 1%;float: left;'>
                                        <div style='height: 60px;width: 100%'>
                                            <div style='height: 30px;width: 100%;line-height: 30px;position: relative;top: 50%;transform: translateY(-50%);'>
                                                <div style='width: 97%;height: 2px;background-color: #c0bfbf;position: relative;top: 50%;transform: translateY(-50%);'></div>
                                                <div style='z-index:1;width: 20px;height: 20px;border-radius: 20px;background-color: #c0bfbf;float: right;margin-right: 5px;position: relative;top: 50%;transform: translateY(-60%);'></div>
                                                <div style='position: relative;width: 40px;height: 40px;top: -13px;right:-36px;float: right;'></div>
                                            </div>
                                        </div>
                                        <div style='height: 30px;text-align: end'>完结</div>
                                    </div>
                                </div>
                            </div>";

        $str.="<div class='solide_box' style='width: 100%;min-height: 480px;padding-top: 60px;padding-left: 25px;padding-right: 25px;'>
                                <div style='height: 64px;border-top: 1px solid #e9e9e9;border-left: 1px solid #e9e9e9;border-right: 1px solid #e9e9e9;'>
                                    <div style='width: 14.2%;float: left;color: #333333;font-size: 16px;height:100%;line-height: 70px;text-align: center;' ><b>序号</b></div>
                                    <div style='width: 20.2%;float: left;color: #333333;font-size: 16px;height:100%;line-height: 70px;text-align: center;' ><b>日期</b></div>
                                    <div style='width: 10.2%;float: left;color: #333333;font-size: 16px;height:100%;line-height: 70px;text-align: center;' ><b>执行人</b></div>
                                    <div style='width: 14.2%;float: left;color: #333333;font-size: 16px;height:100%;line-height: 70px;text-align: center;' ><b>执行类型</b></div>
                                    <div style='width: 12.2%;float: left;color: #333333;font-size: 16px;height:100%;line-height: 70px;text-align: center;' ><b>耗时</b></div>
                                    <div style='width: 14.2%;float: left;color: #333333;font-size: 16px;height:100%;line-height: 70px;text-align: center;' ><b>备注</b></div>
                                    <div style='width: 14.2%;float: left;color: #333333;font-size: 16px;height:100%;line-height: 70px;text-align: center;' ><b>详情</b></div>
                                </div>";
        $proposalID =  $_REQUEST['proposalID'];
        $data = getProposalRecord($proposalID);
        for ($i=0;$i<count($data);$i++){
            $value = $data[$i];
            //(1:待审查,2:未立案,3:待交办,4:办理中,5:待反馈,6:办完结)
            $remarks = '无';
            $ischakan = false;
            switch ($value['operatetype']){
                case '1':
                    $caozuoleixing='提交提案'; //->>待审查
                    break;
                case '2':
                    $caozuoleixing='立案';//->>待交办
                    break;
                case '3':
                    $caozuoleixing='不立案';// ->>未立案
                    $remarks = $value['remarks'];
                    $ischakan = true;
                    break;
                case '4':
                    $caozuoleixing='提案交办';//->>办理中
                    break;
                case '5':
                    //此状态位为后期新增,提交答复件后会有3个选择,满意,基本满意,不满意
                    $caozuoleixing='基本满意';
                    break;
                case '6':
                    $caozuoleixing='接收办理';//->>办理中
                    break;
                case '7':
                    $caozuoleixing='退回';//->>办理中
                    $remarks = $value['remarks'];
                    $ischakan = true;
                    break;
                case '8':
                    $caozuoleixing='提交答复件';//->>待反馈
                    break;
                case '9':
                    $caozuoleixing='满意';//->>办理中
                    break;
                case '10':
                    $caozuoleixing='不满意';//->>待反馈
                    $remarks = $value['remarks'];
                    $ischakan = true;
                    break;
                case '12':
                    $caozuoleixing='抄送';//->>办完结
                    break;
            }

            $str.=" <div>";
            if ($i+1 == count($data)){
                $str.="<div style='height: 64px;border: 1px solid #e9e9e9;'>";
            }else{
                $str.="<div style='height: 64px;border-top: 1px solid #e9e9e9;border-left: 1px solid #e9e9e9;border-right: 1px solid #e9e9e9;'>";
            }

            $str.=             "<div style='width: 14.2%;float: left;color: #666666;font-size: 16px;height:100%;line-height: 70px;text-align: center;' >".($i+1)."</div>
                                <div style='width: 20.2%;float: left;color: #666666;font-size: 16px;height:100%;line-height: 70px;text-align: center;' >".$value['operatetime']."</div>
                                <div style='width: 10.2%;float: left;color: #666666;font-size: 16px;height:100%;line-height: 70px;text-align: center;' >".$value['operatename']."</div>
                                <div style='width: 14.2%;float: left;color: #666666;font-size: 16px;height:100%;line-height: 70px;text-align: center;' >".$caozuoleixing."</div>
                                <div style='width: 12.2%;float: left;color: #666666;font-size: 16px;height:100%;line-height: 70px;text-align: center;' >".$value['processtime']."</div>
                                <div style='width: 14.2%;overflow: hidden;float: left;color: #666666;font-size: 16px;height:100%;line-height: 70px;text-align: center;' >".$remarks."</div>";
            if ($ischakan){
                         $str.="<div style='width: 14.2%;float: left;color: #666666;font-size: 16px;height:100%;line-height: 70px;text-align: center;' >
                                    <a href='?action=".$GLOBALS['ACTION']."&proposalID=".$proposalID."&chakan=".$value['id']."' style='display: inline-block;width: 55px;height: 30px;position: relative;top: 50%;transform: translateY(-50%);'>
                                        <div style='width: 100%;height: 100%;line-height: 30px;border-radius: 4px;color: white;background-color: #e36442'>查看</div>
                                    </a>
                                </div>
                            </div>
                        </div>";
            }else{
                $str .= "</div>
                            </div>";
            }

        }

        $str.="</div>
                        </div>
                    </div>";
        $str .= "<div class='solide_box' style='position: relative;bottom: 25px;width: 100%;border-bottom-left-radius: 10px;border-bottom-right-radius: 10px;height: 25px;background-color: white;'></div>";

        return $str;
    }
}


function zhengxie_outputShenChaDialog($data){
    //增加查看逻辑
    if (!empty($data)){
        $proposalData = getProposalInfo($data['proposalid']);
        $str = "<div style='position: absolute;top: 25%;margin-left: 210px;left: 45%;transform: translateX(-50%); width: 686px;height: 480px;'>
                    <div style='background-color: #3e8ffe;background-size: 100% 100%;border-top-left-radius: 8px;border-top-right-radius: 8px;height: 82px;width: 100%;line-height: 82px;text-align: center;color: white;font-size: 20px;'>
                        反馈
                    </div>
                    <div style='background-color: white;height: 320px;width: 100%;'>
                        <div style='width: 550px;height: 320px;background-color: white;margin: 0px auto;'>
                            <div style='width: 550px;height: 50px; padding-top: 10px'>
                                <div style='float: left;position: relative;top: 10px;font-size: 18px;line-height: 33px;color: #444444;'>审查状态:</div>
                                <div class='choose1' style='position: relative;top: 10px;'>
                                    <label class='radio1' style='margin-left: 30px;line-height: 33px;font-size: 16px'>立案<input type='radio' name='radio' value='1' disabled><i></i></label>
                                    <label class='radio1' style='margin-left: 40px;line-height: 33px;font-size: 16px'>不立案<input type='radio' value='2' name='radio' checked disabled><i></i></label>
                                </div>
                                <style>
                                    .choose1 {position: relative;}
                                    .choose1 .radio1 {position: relative;display: inline-block;font-weight: 400;color: #666666;padding-left: 35px;height: 30px;cursor: pointer;line-height: 30px;font-size: 18px;}
                                    .choose1 .radio1 input {position: absolute;left: -9999px;}
                                    .choose1 .radio1 i {display: block;position: absolute;top: 2px;left: 0;width: 26px;height: 26px;outline: 0;border: 1px solid #e4e4e4;background: #ffffff;border-radius: 50%;background-image: url(images/daifankui/zhihui9.png);background-repeat: no-repeat;transition: border-color .3s;-webkit-transition: border-color .3s;}
                                    .choose1 .radio1 input + i:after {position: absolute;content: '';width: 26px;height: 26px;border-radius: 50%;opacity: 0;transition: opacity .1s;-webkit-transition: opacity .1s;background-image: url(images/daifankui/xuanzhong.png);background-repeat: no-repeat;}
                                    .choose1 .radio1 input:checked + i:after {opacity: 1;}
                                    .feedbackcontent::-webkit-input-placeholder{color:#cacaca;}
                                    .choose2 {position: relative;}
                                    .choose2 .radio2 {position: relative;display: inline-block;font-weight: 400;color: #bababa;padding-left: 35px;height: 30px;cursor: pointer;line-height: 30px;font-size: 18px;}
                                    .choose2 .radio2 input {position: absolute;left: -9999px;}
                                    .choose2 .radio2 i {display: block;position: absolute;top: 2px;left: 0;width: 26px;height: 26px;outline: 0;border: 1px solid #e4e4e4;background: #ffffff;border-radius: 50%;background-image: url(images/daifankui/zhihui9.png);background-repeat: no-repeat;transition: border-color .3s;-webkit-transition: border-color .3s;}
                                    .choose2 .radio2 input + i:after {position: absolute;content: '';width: 26px;height: 26px;border-radius: 50%;opacity: 0;transition: opacity .1s;-webkit-transition: opacity .1s;background-image: url(images/daifankui/xuanzhong.png);background-repeat: no-repeat;}
                                    .choose2 .radio2 input:checked + i:after {opacity: 1;}
                                    .shenchayijian::-webkit-input-placeholder{color:#cacaca;}
                                </style>
                            </div>";

        $str.= "<div style='width: 550px;height: 50px;margin-top: 10px'>
                                <div class='zhongdiantian' style='float: left;position: relative;top: 10px;font-size: 18px;line-height: 33px;color: #bababa;'>重点提案:</div>
                                <div class='choose2' style='position: relative;top: 10px;'>";
        switch ($proposalData['stress']){
            case '0'://不是重点
                $str.="<label class='radio2'  style='margin-left: 30px;line-height: 33px;font-size: 16px'>是<input disabled type='radio'  name='radio_2' value='1' ><i></i></label>
                       <label class='radio2'  style='margin-left: 40px;line-height: 33px;font-size: 16px'>否<input disabled type='radio' value='2' name='radio_2' checked><i></i></label>";
                break;
            case '1'://是重点
                $str.="<label class='radio2'  style='margin-left: 30px;line-height: 33px;font-size: 16px'>是<input disabled type='radio' name='radio_2' value='1' checked><i></i></label>
                       <label class='radio2'  style='margin-left: 40px;line-height: 33px;font-size: 16px'>否<input disabled type='radio' name='radio_2' value='2' ><i></i></label>";
                break;
            case '2'://不是重点
                $str.="<label class='radio2'  style='margin-left: 30px;line-height: 33px;font-size: 16px'>是<input disabled type='radio'  name='radio_2' value='1' ><i></i></label>
                       <label class='radio2'  style='margin-left: 40px;line-height: 33px;font-size: 16px'>否<input disabled type='radio' value='2' name='radio_2' checked><i></i></label>";
                break;
        }

        $str.="</div>
            </div>
            ";
        if (empty($data['remarks'])){
            $remarks = '无';
        }else{
            $remarks = $data['remarks'];
        }

        $sponsor = getSponsorUnitToID($proposalData['sponsor']);
        if (empty($sponsor)){
            $sponsor = '未指定';
        }else{
            $sponsor = $sponsor['unitname'];
        }

        $str.="<div style='width: 550px;height: 50px;margin-top: 10px'>
                            <div class='chengbandanwei_text' style='float: left;position: relative;top: 10px;font-size: 18px;line-height: 30px;color: #bababa;width: 80px;display: inline-block'>承办单位:</div>
                            <input class='chengbandanwei' disabled type='text' value='".$sponsor."' style='font-size: 16px;background-color: #fafdff;border-radius: 4px;color: #666666;border: 1px solid #f3f9fd;margin-left: 10px;width: 454px;height: 40px;position: relative;top: 50%;transform: translateY(-50%);'>
                        </div>
                        
                        <div style='width: 100%;height: 280px;color: #333333; font-size: 18px;margin-top: 16px;'>
                            <div style='float: left;position: relative;top: 5px;font-size: 18px;line-height: 30px;color: #444444;width: 80px;display: inline-block'>审查意见:</div>
                            <textarea class='shenchayijian' disabled style='margin-left: 10px;overflow:auto;resize: none;;width: 454px;height: 84px; color: #666666;font-size: 16px;background-color: #fafdff;border: 1px solid #f1f5f9;'>".$remarks."</textarea>
                        </div>
                         
                    </div>
                </div>
                <div style='background-color: #f0f6ff;background-size: 100% 100%;border-bottom-left-radius: 8px;border-bottom-right-radius: 8px;height: 78px;width: 100%;text-align: center;'>
                    <a onclick='dissmissdialog();' style='width: 210px;height: 48px;display: inline-block;margin: 0px auto;position: relative;top: 50%;transform: translateY(-50%);'><div style='text-align: center;line-height:48px;background-color: #3e8ffe;border-radius: 8px;color: white;font-size: 16px'>返&nbsp;回</div></a>
                </div>
            </div>";

        return $str;
    }

    if (isset($_REQUEST['filelist'])) {
        //下载
        $str="<script>showdialog();</script>";
        $str .= "<div style='position: absolute;top: 25%;margin-left: 210px;left: 45%;transform: translateX(-50%); width: 686px;height: 480px;'>
                    <div style='background-color: #3e8ffe;background-size: 100% 100%;border-top-left-radius: 8px;border-top-right-radius: 8px;height: 82px;width: 100%;line-height: 82px;text-align: center;color: white;font-size: 20px;'>
                        <span style='position: absolute;left: 50%;transform: translateX(-50%)'>文件目录</span>
                        <div class='main_dialog_cuohao' onclick='dissmissdialog()' style='position: relative;top: -20px;background-image: url(images/main/cuohao.png);background-position: center;background-repeat:no-repeat;background-size: 15px;width:40px;height: 82px;float: right'></div>
                    </div>
                    <div style='background-color: white;height: 398px;width: 100%;border-bottom-left-radius: 8px;border-bottom-right-radius: 8px;'>
                        <div class='solide_box' style='width: 600px;height: 398px;background-color: white;overflow: auto;padding-top: 20px;margin: 0px auto;'>
                            <span style='color: #999999'>内容下载</span>";

        if ($_REQUEST['filelist'] != 0){
            $data = array();
            $sql = "select * from enclosure where id in(".$_REQUEST['filelist'].")";
            error_log($sql);
            $result = $GLOBALS['DB']->query($sql);
            while($res=$result->fetch()) {
                $data[] = $res;
            }

            foreach ($data as $value){
                $str.="<div style='width: 100%;height: 50px;background: url(images/daifankui/wenjianjia.png) no-repeat 10px'>
                <div style='overflow: hidden;display: inline-block;margin-left: 50px;max-width: 350px;height: 50px;line-height: 50px'>".$value['enclosurename']."</div>
                <a href='".$value['enclosureurl']."' style='float: right;position: relative;top: 50%;transform: translateY(-50%)'><img style='width: 32px;height: 32px;' src='images/daifankui/xiazai.png'></a>
                <div style='color: #999999;max-width: 130px;height: 50px;line-height: 50px;margin-right: 20px;float: right'>".$value['enclosuretime']."</div>
             </div>";
            }
        }
        $str.="</div>
                    </div>
                </div>";
        return $str;
    }

    //如果为空
    if (empty($_REQUEST['dialog'])){
        $dialog = '';
    }else{
        $dialog = $_REQUEST['dialog'];
    }

    if ($dialog === 'shenchadialog'){
        $str="<script>$('.reuse_dialog').show()</script>";
    }else{
        $str="<script>$('.reuse_dialog').hide()</script>";
    }
    $str .= "<div class='commitDialog' style='position: absolute;top: 25%;margin-left: 210px;left: 45%;transform: translateX(-50%); width: 686px;height: 480px;'>
                    <div style='background-color: #3e8ffe;background-size: 100% 100%;border-top-left-radius: 8px;border-top-right-radius: 8px;height: 82px;width: 100%;line-height: 82px;text-align: center;color: white;font-size: 20px;'>
                        反馈
                        <a onclick='dissmissdialog();' style='display: inline-block;width: 20px;height: 20px;position: absolute;right: 20px;top: -10px;'><div>X</div></a>
                    </div>
                    <div style='background-color: white;height: 320px;width: 100%;'>
                        <div style='width: 550px;height: 320px;background-color: white;margin: 0px auto;'>
                            <div style='width: 550px;height: 50px; padding-top: 10px'>
                                <div style='float: left;position: relative;top: 10px;font-size: 18px;line-height: 33px;color: #444444;'>审查状态:</div>
                                <div class='choose1' style='position: relative;top: 10px;'>
                                    <label class='radio1' style='margin-left: 30px;line-height: 33px;font-size: 16px'>立案<input class='lian' type='radio' name='radio' value='1' checked><i></i></label>
                                    <label class='radio1' style='margin-left: 40px;line-height: 33px;font-size: 16px'>不立案<input class='bulian' type='radio' value='2' name='radio' ><i></i></label>
                                </div>
                                <style>
                                    .choose1 {position: relative;}
                                    .choose1 .radio1 {position: relative;display: inline-block;font-weight: 400;color: #666666;padding-left: 35px;height: 30px;cursor: pointer;line-height: 30px;font-size: 18px;}
                                    .choose1 .radio1 input {position: absolute;left: -9999px;}
                                    .choose1 .radio1 i {display: block;position: absolute;top: 2px;left: 0;width: 26px;height: 26px;outline: 0;border: 1px solid #e4e4e4;background: #ffffff;border-radius: 50%;background-image: url(images/daifankui/zhihui9.png);background-repeat: no-repeat;transition: border-color .3s;-webkit-transition: border-color .3s;}
                                    .choose1 .radio1 input + i:after {position: absolute;content: '';width: 26px;height: 26px;border-radius: 50%;opacity: 0;transition: opacity .1s;-webkit-transition: opacity .1s;background-image: url(images/daifankui/xuanzhong.png);background-repeat: no-repeat;}
                                    .choose1 .radio1 input:checked + i:after {opacity: 1;}
                                    .feedbackcontent::-webkit-input-placeholder{color:#cacaca;}
                                    .choose2 {position: relative;}
                                    .choose2 .radio2 {position: relative;display: inline-block;font-weight: 400;color: #bababa;padding-left: 35px;height: 30px;cursor: pointer;line-height: 30px;font-size: 18px;}
                                    .choose2 .radio2 input {position: absolute;left: -9999px;}
                                    .choose2 .radio2 i {display: block;position: absolute;top: 2px;left: 0;width: 26px;height: 26px;outline: 0;border: 1px solid #e4e4e4;background: #ffffff;border-radius: 50%;background-image: url(images/daifankui/zhihui9.png);background-repeat: no-repeat;transition: border-color .3s;-webkit-transition: border-color .3s;}
                                    .choose2 .radio2 input + i:after {position: absolute;content: '';width: 26px;height: 26px;border-radius: 50%;opacity: 0;transition: opacity .1s;-webkit-transition: opacity .1s;background-image: url(images/daifankui/xuanzhong.png);background-repeat: no-repeat;}
                                    .choose2 .radio2 input:checked + i:after {opacity: 1;}
                                    .shenchayijian::-webkit-input-placeholder{color:#cacaca;}
                                </style>
                            </div>";

                    $str.= "<div style='width: 550px;height: 50px;margin-top: 10px'>
                                <div class='zhongdiantian' style='float: left;position: relative;top: 10px;font-size: 18px;line-height: 33px;color: #444444;'>重点提案:</div>
                                <div class='choose2' style='position: relative;top: 10px;'>
                                    <label class='radio2'  style='margin-left: 30px;line-height: 33px;font-size: 16px'>是<input class='shi' type='radio' disabled='disabled' name='radio_2' value='1' ><i></i></label>
                                    <label class='radio2'  style='margin-left: 40px;line-height: 33px;font-size: 16px'>否<input class='fou' disabled='disabled' type='radio' value='2' name='radio_2' checked><i></i></label>
                                </div>
                                <script>
                                    $('.fou').attr('disabled',false);
                                    $('.shi').attr('disabled',false);
                                    $('.radio2').css('color','#666666');
                                
                                    $('.lian').click(function() {
                                           $('.fou').attr('disabled',false);
                                           $('.shi').attr('disabled',false);
                                           $('.chengbandanwei').attr('disabled',false);
                                          
                                           
                                           $('.zhongdiantian').css('color','#444444');
                                           $('.chengbandanwei_text').css('color','#444444');
                                           $('.radio2').css('color','#666666');
                                    });  
                                     $('.bulian').click(function() {
                                           $('.shi').attr('disabled','disabled');
                                           $('.fou').attr('disabled','disabled');
                                           $('.chengbandanwei').attr('disabled','true');
                                           $('.chengbandanwei').val('');
                                           
                                           
                                           $('.zhongdiantian').css('color','#bababa');
                                           $('.chengbandanwei_text').css('color','#bababa');
                                           $('.radio2').css('color','#bababa');
                                    });  
                                </script>
                            </div>
                            ";

                    $str.="<div style='width: 550px;height: 50px;margin-top: 10px'>
                                <div class='chengbandanwei_text' style='float: left;position: relative;top: 10px;font-size: 18px;line-height: 30px;color: #444444;width: 80px;display: inline-block'>承办单位:</div>
                                <input class='chengbandanwei'  type='text' style='font-size: 16px;background-color: #fafdff;border-radius: 4px;color: #444444;border: 1px solid #f3f9fd;margin-left: 10px;width: 454px;height: 40px;position: relative;top: 50%;transform: translateY(-50%);'>
                                <ul class='sub'>
                                </ul>
                                <style>
                                    .sub{list-style-type:none;z-index: 5}
                                    .sub{font-size: 16px;position: absolute;top: 257px;left:159px;color:#e5e5e5;width:454px;height:230px;overflow: auto;background:#fff;border:1px solid #e5e5e5;display: none;}
                                    .sub li{color: #666666;height:40px;text-align: center;line-height:40px;cursor:pointer;border-bottom:1px solid #e5e5e5;}
                                    .sub li.hover{background:#8b8b8b;}
                                </style>
                                <script>
                                    $('.chengbandanwei').bind('input propertychange',function() {
                                        var keyword = $(this).val();
                                        
                                        $.getJSON('api.php?action=api_searchSponsor',{'keyword':keyword},function(res) {
                                            if (res.code == 0){
                                                
                                               if (res.data.length != 0){
                                                   $('.sub').empty();
                                                    res.data.forEach(function (t, number) { 
                                                         $('.sub').append('<li>'+t.unitname+'</li>');
                                                    });
                                                    $('.sub').css('display','block');
                                                    $('.sub li').each(function() {
                                                        $(this).mouseover(function() {
                                                            $(this).css('background-color','#429de3');
                                                        });
                                                        
                                                        $(this).mouseout(function() {
                                                            $(this).css('background-color','#fff');
                                                        });
                                                        
                                                        $(this).click(function() {
                                                          var text = $(this).text();
                                                          $('.chengbandanwei').val(text);
                                                          $('.sub').css('display','none');
                                                        });
                                                    });
                                               }
                                               
                                            }
                                        });
                                    });
                                </script>
                            </div>
                            
                            <div style='width: 100%;height: 280px;color: #333333; font-size: 18px;margin-top: 16px;'>
                                <div style='float: left;position: relative;top: 5px;font-size: 18px;line-height: 30px;color: #444444;width: 80px;display: inline-block'>审查意见:</div>
                                <textarea class='shenchayijian'  placeholder='不少于15字'  style='margin-left: 10px;overflow:auto;resize: none;;width: 454px;height: 84px; color: #666666;font-size: 16px;background-color: #fafdff;border: 1px solid #f1f5f9;'></textarea>
                            </div>
                             
                        </div>
                    </div>
                    <div style='background-color: #f0f6ff;background-size: 100% 100%;border-bottom-left-radius: 8px;border-bottom-right-radius: 8px;height: 78px;width: 100%;text-align: center;'>
                        <a onclick='updateProposalState();' style='width: 210px;height: 48px;display: inline-block;margin: 0px auto;position: relative;top: 50%;transform: translateY(-50%);'><div style='text-align: center;line-height:48px;background-color: #3e8ffe;border-radius: 8px;color: white;font-size: 16px'>确&nbsp;定</div></a>
                    </div>
                </div>";

    $str .= "   <div class='successDialog' style='display: none;position: absolute;top: 25%;margin-left: 210px;left: 45%;transform: translateX(-50%); width: 686px;height: 460px;'>
                        <div style='background-color: #429de3;background-image: url(/images/login/reset.png);background-size: 100% 100%;border-top-left-radius: 8px;border-top-right-radius: 8px;height: 194px;width: 100%'>
                            
                        </div>
                        <div style='background-color: white;height: 264px;width: 100%;border-bottom-left-radius: 8px;border-bottom-right-radius: 8px;'>
                            <div style='width: 390px;height: 190px;margin: 0px auto;'>
                                <div  style='color: #87ba4d;font-size: 26px;text-align: center;position: relative;top: 30%;transform: translateY(-30%);'>提交成功!</div>
                                <div class='successMessage' style='color: #87ba4d;font-size: 14px;text-align: center;position: relative;top: 50%;transform: translateY(-50%);'></div>
                                
                            </div>
                            <div  style='background-color: white;height: 74px;width: 100%;border-bottom-left-radius: 8px;border-bottom-right-radius: 8px;'>
                                <div style='border-bottom-left-radius: 8px;border-bottom-right-radius: 8px;font-size: 18px;color: #469ee3;height: 74px;width: 100%;line-height: 74px;text-align: center;border-top: 1px solid #d2ebff'>
                                    <script>
                                        function success(){
                                            window.location.href = '?action=shencha';
                                        }
                                    </script>
                                    <button onclick='success();' style='background-color: #3e8ffe;width: 210px;height: 48px;border-radius: 10px;color: white;position: relative;font-size: 16px;margin: 0 auto;position: relative;top: 50%;transform: translateY(-50%);'>确定</button>
                                </div>
                            </div>
                        </div>
                    </div>";
    return $str;
}